package com.googlecode.gwtbb.client.shared.remote.forum;

import com.googlecode.gwtbb.client.shared.entity.forum.Forum;
import com.googlecode.gwtbb.client.shared.entity.forum.Post;
import com.googlecode.gwtbb.client.shared.remote.ClientResponse;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Apr 30, 2008
 */
public class CreatePostResponse extends ClientResponse implements CreatePostEvent {
	private Forum forum;
	private Post post;

	public Forum getForum() {
		return forum;
	}

	public void setForum(Forum forum) {
		this.forum = forum;
	}

	public Post getPost() {
		return post;
	}

	public void setPost(Post post) {
		this.post = post;
	}

	public Post getThread() {
		if (post == null)
			return null;
		if (post.isThread())
			return post;
		Post.Info postInfo = post.getInfo();
		return postInfo != null ? postInfo.getThread() : null;
	}
}